package cn.itcast.dao;

import cn.itcast.domain.Courier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface CourierDao extends JpaRepository<Courier,Integer>,JpaSpecificationExecutor<Courier> {


    /**
     * 激活快递员
     * @param id
     */
    @Query(value="update Courier set deltag = '0' where id = ?1")
    @Modifying
    void activeBatch(Integer id);

    /**
     * 恢复快递员
     * @param id
     */
    @Query(value="update Courier set deltag = '1' where id = ?1")
    @Modifying
    void resBatch(Integer id);




    /**
     * 作废快递员
     * @param id
     */
    @Query(value="update Courier set deltag = '2' where id = ?1")
    @Modifying
    void delInBatch(Integer id);

}
